﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ORMAC.CodeGen;

namespace ORMAC.UI
{
    public class DatabaseImportWizard
    {
        public void RunWizard()
        {
            List<TableInfo> dbSchema = null;
            DlgSelectDB selectDlg = new DlgSelectDB();
            selectDlg.ShowDialog();
            if (selectDlg.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                IDBSchema schema = new SQLShema();
                dbSchema= schema.RetrieveSchema<TableInfo>(selectDlg.ConnectionString);
                DlgSelectTables dlgTables = new DlgSelectTables();
                dlgTables.Tables = dbSchema;
                dlgTables.ShowDialog();
            }
        }
    }
}
